package cn.wolfcode.feign;

import cn.wolfcode.common.web.Result;
import cn.wolfcode.domain.PayVo;
import cn.wolfcode.domain.RefundVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

@FeignClient(name = "pay-service")
public interface AliPayApi {
    //远程调用支付服务接口：验签操作
    @RequestMapping("/alipay/rsaCheck")
    Result<Boolean> rsaCheck(@RequestBody Map<String, String> params);
    //远程调用支付服务：支付操作
    @RequestMapping("/alipay/orderPay") //注意发送请求时，@RequestBody是以json格式发送数据的（通常用于map等集合）
    Result<String> orderAlipay(@RequestBody PayVo payVo);
    //远程调用支付服务：退款操作
    @RequestMapping("/alipay/refund")
    Result<Boolean> refund(@RequestBody RefundVo refundVo);
}
